HTML (HyperText Markup Language) is the standard language for creating web pages. HTML consists of various elements, which are building blocks that define the structure and content of a webpage.
An HTML element typically consists of an ✔️opening tag, ✔️content, and a ✔️closing tag
The example HTML Element above is composed of the following:
<p> is the opening tag.
`This is a paragraph.` is the content.
</p> is the closing tag.
Nested HTML Elements
There are cases that an HTML element can contain one or more HTML elements, for you to better understand it, look at the code below.
All the followings are called HTML Elements
<html> – The root element of an HTML document.
<head> – Contains metadata, links to stylesheets, and scripts.
<title> – Specifies the title of the page.
<body> – Contains the content displayed on the webpage.
<header> – Defines a section header.
<footer> – Defines a footer for a section or page.
<section> – Defines a standalone section of a document.
<article> – Represents a self-contained piece of content.
<aside> – Contains related content (e.g., a sidebar).
<nav> – Defines navigation links.
<main> – Represents the main content of a page.
<div> – A container used for styling and layout.
<h1> to <h6> – Headings (<h1> is the largest, <h6> is the smallest).